package com.web.java0328springboot.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.web.java0328springboot.entity.PageVO;
import com.web.java0328springboot.entity.Student;
import com.web.java0328springboot.mapper.StudentMapper;
import com.web.java0328springboot.service.StudentService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class StudentSerivceImpl extends ServiceImpl<StudentMapper, Student> implements StudentService {

    @Resource
    private StudentMapper studentMapper;

    @Override
    public PageVO getStudentPage(Integer current, Integer pageSize) {
        IPage<Student> page = studentMapper.selectStudentPage(new Page<>(current, pageSize));
        PageVO pageVO = new PageVO(page.getCurrent(),page.getSize(),page.getTotal(),page.getRecords());
        return pageVO;
    }
}
